<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<script type="text/javascript">
        $(document).ready(function() {
            //建议在#imgDiv的父元素上加个overflow:hidden;的css样式
            $("input").uploadPreview({ width: 200, height: 200, imgDiv: "#imgDiv", imgType: ["bmp", "gif", "png", "jpg"] });
        });
    </script>
<div id="img" style="display: none;">
<form action="upload.do" method="POST" enctype="multipart/form-data">
	<input type="file" name="file" value="浏览"/>
	  <div id="imgDiv" style="width: 200px; height: 200px; overflow: hidden; border: 1px solid red;display: none;"></div>
   	<button id="upload">上传</button>
</form>
</div>